/*
 * @Author: yangzonglong
 * @Date: 2021-03-10 13:54:27
 * @version: v1.0.0
 * @Descripttion: 获取 select radio checkobx 数据
 * @LastEditors: yangzonglong
 * @LastEditTime: 2021-03-29 15:30:10
 * @Auditor: 
 */
import { useState, useEffect } from 'react'

const useSelectDataSource = (dataSource?: any[], url?: string) => {
  const [data, setData] = useState<any[]>([])

  useEffect(() => {
    if(dataSource) return setData(dataSource);
    setData([])
  }, [dataSource])

  return data
}

export default useSelectDataSource;